FUNCTION mathews() implements the Mathews's variable step size CLMS algorithm Based on the paper "A stochastic gradient adaptive filter with gradient adaptive step size", IEEE Trans. Signal Processing, vol. 41, pp. 2075-2087, 1993. INPUT: x: input signal N: filter length mu: step-size rho: step-size of adaptation of mu OUTPUT: y: filter output Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB Supplementary to the book: "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models" by Danilo P. Mandic and Vanessa Su Lee Goh (c) Copyright Danilo P. Mandic 2009 http://www.commsp.ee.ic.ac.uk/~mandic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You can obtain a copy of the GNU General Public License from http://www.gnu.org/copyleft/gpl.html or by writing to Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ...........................................
0001 % FUNCTION mathews() implements the Mathews's variable step size CLMS algorithm 0002 % 0003 % Based on the paper "A stochastic gradient adaptive filter with gradient adaptive step size", 0004 % IEEE Trans. Signal Processing, vol. 41, pp. 2075-2087, 1993. 0005 % 0006 % INPUT: 0007 % x: input signal 0008 % N: filter length 0009 % mu: step-size 0010 % rho: step-size of adaptation of mu 0011 % 0012 % OUTPUT: 0013 % y: filter output 0014 % 0015 % 0016 % Complex Valued Nonlinear Adaptive Filtering toolbox for MATLAB 0017 % Supplementary to the book: 0018 % 0019 % "Complex Valued Nonlinear Adaptive Filters: Noncircularity, Widely Linear and Neural Models" 0020 % by Danilo P. Mandic and Vanessa Su Lee Goh 0021 % 0022 % (c) Copyright Danilo P. Mandic 2009 0023 % http://www.commsp.ee.ic.ac.uk/~mandic 0024 % 0025 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0026 % This program is free software; you can redistribute it and/or modify 0027 % it under the terms of the GNU General Public License as published by 0028 % the Free Software Foundation; either version 2 of the License, or 0029 % (at your option) any later version. 0030 % 0031 % This program is distributed in the hope that it will be useful, 0032 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0033 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0034 % GNU General Public License for more details. 0035 % 0036 % You can obtain a copy of the GNU General Public License from 0037 % http://www.gnu.org/copyleft/gpl.html or by writing to 0038 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0039 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0040 % ........................................... 0041 function y = Mathews(x,N,mu,rho) 0042 0043 M = 1;% prediction horizon 0044 L = length(x)-M; % length of simulation 0045 filterinput = zeros(N,L);%input of FIR 0046 filteroutput = zeros(1,L);%output of FIR 0047 learning = zeros(1,L);% the adaptive learning rate; 0048 Phi = zeros(N,1); 0049 WVSLMS = zeros(N,1);% weight 0050 eVSLMS = zeros(1,L);% error 0051 EVSLMS = zeros(1,L);% mean square error 0052 filteroutput = zeros(1,L);% output 0053 0054 0055 0056 for i = 1:L 0057 for m = 1:N 0058 if (i-m+1)>0 0059 filterinput(m,i) = x(1,i-m+1); 0060 else 0061 filterinput(m,i) = 0; 0062 end 0063 end % inputing FIR 0064 filteroutput(i) = transpose(filterinput(:,i)) * WVSLMS;% 0065 eVSLMS(i) = x(i+M) - filteroutput(i);% 0066 EVSLMS(i) = 10 * log10(1/2 * eVSLMS(i)' * eVSLMS(i)); 0067 if i == 1 0068 learning(1) = mu; 0069 Phi = zeros(N,1); 0070 else 0071 Phi = eVSLMS(i-1) * conj(filterinput(:,i-1)); 0072 learning(i) = learning(i-1) + rho * real(eVSLMS(i) * filterinput(:,i)'* conj(Phi)); 0073 end 0074 WVSLMS = WVSLMS + learning(i) * eVSLMS(i) * conj(filterinput(:,i)); 0075 end 0076 y = filteroutput; 0077 0078 0079 0080 0081